if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GetClinicalTrialBudgetFeedData]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[GetClinicalTrialBudgetFeedData]
GO
SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO



CREATE PROCEDURE [dbo].[GetClinicalTrialBudgetFeedData]( @institution varchar(256) )
AS
BEGIN
   SET NOCOUNT ON
   If @institution = 'ClinicalTrialBudgetInstitutionMGH'
      BEGIN
        SELECT * 
		FROM mgh_cdmfeed 
		WHERE description is not null 
			and description <> ''
		ORDER BY Description
      END
   Else If @institution = 'ClinicalTrialBudgetInstitutionBWH'
      BEGIN
        SELECT Dept as 'Dept', Description as 'Description', Price as 'Price', ChargeCode as 'ChargeCode', CPTCode as 'CPTCode', IndustryRate as 'ResearchRate'
		FROM bwh_cdmfeed 
		WHERE description is not null 
			and description <> ''
		ORDER BY Description
      END
END

